#include "PhysxActor.h"

PhysxActor::PhysxActor(void)
{
	actor = NULL;
	physxObjectType = PhysxObjectType::Actor;
	transform =  (XMMATRIX*) _aligned_malloc(sizeof(XMMATRIX),16);
	ScaleTransform =  (XMMATRIX*) _aligned_malloc(sizeof(XMMATRIX),16);
	*ScaleTransform = XMMatrixIdentity();
}

PhysxActor::~PhysxActor(void)
{	
	_aligned_free(transform);
	_aligned_free(ScaleTransform);
}

XMMATRIX* PhysxActor::GetWorldTransformation()
{	
	actor->getGlobalPose().getColumnMajor44(worldMatrix);	
	*transform = XMLoadFloat4x4( (XMFLOAT4X4* ) worldMatrix ); ///wow !!! this fucking worlds !!?????
	*transform = XMMatrixMultiply(*ScaleTransform,*transform);
	return transform;
}
